<template>
  <div class="app-container">
    <Tabs :active-value="queryParams.businessType" :tabs="tabs" @change="changeTab"></Tabs>
    <div>
      <BankCategoryList v-show="queryParams.businessType==1" ref="bankCategoryList"></BankCategoryList>
      <AccountOpenbankList v-show="queryParams.businessType==2" ref="accountOpenbankList"></AccountOpenbankList>
      <BankAccountList v-show="queryParams.businessType==3" ref="bankAccountList"></BankAccountList>
    </div>

  </div>
</template>

<script>
import SearchContent from "@/components/SearchContent/index.vue";
import Tabs from "@/components/Tabs/index.vue"
import BankCategoryList from "@/views/system/ncInfo/components/bankInfo/BankCategoryList.vue";
import AccountOpenbankList from "@/views/system/ncInfo/components/bankInfo/AccountOpenbankList.vue";
import BankAccountList from "@/views/system/ncInfo/components/bankInfo/BankAccountList.vue";

export default {
  name: "BankList",
  components: {
    BankAccountList,
    AccountOpenbankList,
    BankCategoryList,
    SearchContent,
    Tabs
  },
  dicts: ['business_type', 'customer_type', 'need_credit_review', 'sys_enable_status'],
  data() {
    return {

      tabs: [
        {
          label: '银行类别',
          value: 1,
        },
        {
          label: '开户行',
          value: 2,
        },
        {
          label: '银行账户',
          value: 3,
        }
      ],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        bankTypeName:null,
        businessType:1,
      },

    };
  },
  mounted() {

  },
  activated() {
    this.handleQuery()
  },
  methods: {
    changeTab(value) {
      this.queryParams.businessType = value;
      this.handleQuery();
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;

    },
    /** 重置按钮操作 */
    resetQuery() {
      this.$nextTick(()=>{
        this.$refs?.queryForm?.resetFields();
        this.handleQuery();
      })
    }

  }
};
</script>
